package ae.pcfc.etks.online.common.domain;


import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * TEtksProcessStepId @author Mohtisham.Salahria
 */
@Embeddable
public class ProcessStepId implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private String processStepCode;
	private String processCode;

	public ProcessStepId() {
	}

	public ProcessStepId(String processStepCode, String processCode) {
		this.processStepCode = processStepCode;
		this.processCode = processCode;
	}

	@Column(name = "PROCESS_STEP_CODE", nullable = false, length = 10)
	public String getProcessStepCode() {
		return this.processStepCode;
	}

	public void setProcessStepCode(String processStepCode) {
		this.processStepCode = processStepCode;
	}

	@Column(name = "PROCESS_CODE", nullable = false, length = 10)
	public String getProcessCode() {
		return this.processCode;
	}

	public void setProcessCode(String processCode) {
		this.processCode = processCode;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ProcessStepId))
			return false;
		ProcessStepId castOther = (ProcessStepId) other;

		return ((this.getProcessStepCode() == castOther.getProcessStepCode()) || (this
				.getProcessStepCode() != null
				&& castOther.getProcessStepCode() != null && this
				.getProcessStepCode().equals(castOther.getProcessStepCode())))
				&& ((this.getProcessCode() == castOther.getProcessCode()) || (this
						.getProcessCode() != null
						&& castOther.getProcessCode() != null && this
						.getProcessCode().equals(castOther.getProcessCode())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getProcessStepCode() == null ? 0 : this.getProcessStepCode()
						.hashCode());
		result = 37
				* result
				+ (getProcessCode() == null ? 0 : this.getProcessCode()
						.hashCode());
		return result;
	}

}
